﻿using amiba.web.Areas.api.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace amiba.web.Areas.api.Data
{


    public class BudgetContext : DbContext
    {
        public BudgetContext() { 
        }
        public BudgetContext(DbContextOptions<BudgetContext> options)
            : base(options)
        {
        }
        
       protected override void OnModelCreating(ModelBuilder modelBuilder)
       {
           base.OnModelCreating(modelBuilder);
       }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseLazyLoadingProxies(false);
            // var builder = new ConfigurationBuilder()
            //.SetBasePath(Directory.GetCurrentDirectory())
            //.AddJsonFile("appsettings.json");
            // var configuration = builder.Build();
            // var conn = configuration.GetConnectionString("JDDbConnection");

            //optionsBuilder.UseSqlServer(this._IConfiguration.GetConnectionString("JDDbConnectionString"));


            //optionsBuilder.UseLoggerFactory(new CustomEFLoggerFactory());

            //optionsBuilder.UseSqlServer(StaticConstraint.JDDbConnection);

            //optionsBuilder.UseSqlServer("Server=.;Database=advanced11;User id=sa;password=Passw0rd");

        }
        public DbSet<BudgetDetail> BudgetDetails;
        public DbSet<ProjectPackage> ProjectPackages;
        public DbSet<BudgetMain> BudgetMains;
        public DbSet<BudgetSubject> BudgetSubjects;
    }
}
